package com.appspot.bs24event.model;

import java.io.Serializable;
import java.util.Date;

import org.slim3.datastore.Attribute;
import org.slim3.datastore.Model;

import com.google.appengine.api.datastore.Key;

/**
 * Eventクラス。
 *
 * @version $Id: Event.java 167 2011-08-11 03:43:48Z bs24event@gmail.com $
 */
@Model(schemaVersion = 1)
public class Event implements Serializable {

    private static final long serialVersionUID = 1L;

    @Attribute(primaryKey = true)
    private Key key;

    @Attribute(version = true)
    private Long version;

    /** タイトル */
    private String title;
    /** 開催日 */
    private Date eventDate = new Date();
    /** 開始時刻：時 */
    private String eventStartHour;
    /** 終了時刻：時 */
    private String eventEndHour;
    /** 開始時刻：分 */
    private String eventStartMin;
    /** 終了時刻：分 */
    private String eventEndMin;
    /** 場所 */
    private String place;
    /** 住所 */
    private String address;
    /** 会費 */
    private String fee;
    /** 予約名 */
    private String reservedName;
    /** URL */
    private String url;
    /** 備考 */
    private String note;
    /** 作成日 */
    private Date createdDate = new Date();
    /** 更新日 */
    private Date updateDate = new Date();

    /**
     * Returns the key.
     *
     * @return the key
     */
    public Key getKey() {
        return key;
    }

    /**
     * Sets the key.
     *
     * @param key
     *            the key
     */
    public void setKey(Key key) {
        this.key = key;
    }

    /**
     * Returns the version.
     *
     * @return the version
     */
    public Long getVersion() {
        return version;
    }

    /**
     * Sets the version.
     *
     * @param version
     *            the version
     */
    public void setVersion(Long version) {
        this.version = version;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Date getEventDate() {
        return eventDate;
    }

    public void setEventDate(Date eventDate) {
        this.eventDate = eventDate;
    }

    public String getEventStartHour() {
        return eventStartHour;
    }

    public void setEventStartHour(String eventStartHour) {
        this.eventStartHour = eventStartHour;
    }

    public String getEventEndHour() {
        return eventEndHour;
    }

    public void setEventEndHour(String eventEndHour) {
        this.eventEndHour = eventEndHour;
    }

    public String getEventStartMin() {
        return eventStartMin;
    }

    public void setEventStartMin(String eventStartMin) {
        this.eventStartMin = eventStartMin;
    }

    public String getEventEndMin() {
        return eventEndMin;
    }

    public void setEventEndMin(String eventEndMin) {
        this.eventEndMin = eventEndMin;
    }

    public String getPlace() {
        return place;
    }

    public void setPlace(String place) {
        this.place = place;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getFee() {
        return fee;
    }

    public void setFee(String fee) {
        this.fee = fee;
    }

    public String getReservedName() {
        return reservedName;
    }

    public void setReservedName(String reservedName) {
        this.reservedName = reservedName;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public Date getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((key == null) ? 0 : key.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        Event other = (Event) obj;
        if (key == null) {
            if (other.key != null) {
                return false;
            }
        } else if (!key.equals(other.key)) {
            return false;
        }
        return true;
    }

}
